package top.aicey.ai.sparring.service.impl;

import java.time.LocalDateTime;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import top.aicey.ai.sparring.entity.SceneInstance;
import top.aicey.ai.sparring.mapper.SceneInstanceMapper;
import top.aicey.ai.sparring.service.ISceneInstanceService;

/**
 * <p>
 * 用户通话日志 服务实现类
 * </p>
 *
 * @author 白杨
 * @since 2025-01-14
 */
@Service
public class SceneInstanceServiceImpl extends ServiceImpl<SceneInstanceMapper, SceneInstance> implements ISceneInstanceService {
    @Override
    public String generateUserCallRecord(String moduleId,Long sceneId,String id,String userId, String instanceId) {
        SceneInstance record = new SceneInstance();
        record.setCreatedBy(userId);
        record.setUpdatedBy(userId);
        record.setCreatedAt(LocalDateTime.now());
        record.setUpdatedAt(LocalDateTime.now());
        record.setLiveInstanceId(instanceId);
        record.setModuleId(moduleId);
        record.setSceneId(sceneId);
        record.setId(id);
        this.save(record);
        return record.getId();
    }
}
